import req from '@/utils/request';
import type {
    LoginFormData,
    LoginResponseData,
    UserInfoResponseData
} from './type'

// api枚举定义

enum API {
    LOGIN = '/user/login',
    USER_INFO = '/user/detail'
}

// 用户登录接口
export const loginApi = (data: LoginFormData) => {
    return req.post<LoginResponseData>(API.LOGIN, data);
}

// 获取用户信息接口
export const userInfoApi = () => {
    return req.get<UserInfoResponseData>(API.USER_INFO);
}